/*****************************************************************
Mix3D WebGL Game Engine
Copyright (c) fantasy ( fantasy.x2x@gmail.com )
Listens:
Distributed under the Boost Software License, Version 1.0.
http://www.boost.org/LICENSE_1_0.txt
 ****************************************************************/
/**
 * @Desc    : light
 * @Author  : fantasy(fantasy.x2x@gmail.com)
 */
//////////////////////////////////////////////////////////////////
if(typeof(Mix3D) === 'undefined')
{
  Mix3D = {};
};
(function(Mix3D){
//////////////////////////////////////////////////////////////////
//
//    light
//
//////////////////////////////////////////////////////////////////
Mix3D.Light = function(hexColor)
{
  Mix3D.Spatial.call(this);
  this.color = new Mix3D.Color(hexColor);
};

Mix3D.Light.prototype.constructor = Mix3D.Light;
Mix3D.Light.prototype.className = 'Light';
Mix3D.protoCopy(Mix3D.Spatial, Mix3D.Light);
//////////////////////////////////////////////////////////////////
//
//    Ambient Light
//
//////////////////////////////////////////////////////////////////
Mix3D.AmbientLight = function( hexColor )
{
	Mix3D.Light.call(this, hexColor);
};
Mix3D.AmbientLight.prototype.constructor = Mix3D.AmbientLight;
Mix3D.AmbientLight.prototype.className = 'AmbientLight';
Mix3D.protoCopy(Mix3D.Light, Mix3D.AmbientLight);
//////////////////////////////////////////////////////////////////
//
//    Point Light
//
//////////////////////////////////////////////////////////////////
Mix3D.PointLight = function( hexColor, intensity, distance )
{
	Mix3D.Light.call(this, hexColor);
	this.intensity = ( intensity !== undefined ) ? intensity : 1;
	this.distance = ( distance !== undefined ) ? distance : 0;
};
Mix3D.PointLight.prototype.constructor = Mix3D.PointLight;
Mix3D.PointLight.prototype.className = 'PointLight';
Mix3D.protoCopy(Mix3D.Light, Mix3D.PointLight);

//////////////////////////////////////////////////////////////////
//
//    Direction Light
//
//////////////////////////////////////////////////////////////////
Mix3D.DirLight = function( hexColor, intensity, distance )
{
	Mix3D.Light.call(this, hexColor);
	
	this.intensity = ( intensity !== undefined ) ? intensity : 1;
	this.distance = ( distance !== undefined ) ? distance : 0;
};
Mix3D.DirLight.prototype.constructor = Mix3D.DirLight;
Mix3D.DirLight.prototype.className = 'DirLight';
Mix3D.protoCopy(Mix3D.Light, Mix3D.DirLight);

//////////////////////////////////////////////////////////////////
//
//    Spot Light
//
//////////////////////////////////////////////////////////////////
Mix3D.SpotLight = function( hexColor, intensity, distance, angle, exponent )
{
	Mix3D.Light.call(this, hexColor);
	
	this.intensity = ( intensity !== undefined ) ? intensity : 1;
	this.distance = ( distance !== undefined ) ? distance : 0;
	this.angle = ( angle !== undefined ) ? angle : Math.PI / 2;
	this.exponent = ( exponent !== undefined ) ? exponent : 10;

};
Mix3D.SpotLight.prototype.constructor = Mix3D.SpotLight;
Mix3D.SpotLight.prototype.className = 'SpotLight';
Mix3D.protoCopy(Mix3D.Light, Mix3D.SpotLight);

//////////////////////////////////////////////////////////////////
})(Mix3D);// end of function(Mix3D)